/*
*  Shape3D.cpp
*
*  Created on: Jan 14, 2012
*  
*/


#include  "Shape3D.h"



namespace Physics
{
#pragma region CONSTRUCTORs
	//C001: Default Constructor
	Shape3D::Shape3D()
	{
		this->position = Vector3();
		this->direction = Vector3();

		this->speed = this->mass = 0;
	}

	//C002: Overloaded Constructor
	Shape3D::Shape3D(const Vector3 &pos)
	{
		this->position = pos;
		this->direction = Vector3();

		this->speed = this->mass = 0;
	}

	//C003: Overloaded Constructor
	Shape3D::Shape3D(const Vector3 &pos = Vector3(), const Vector3 &dir = Vector3() )
	{
		this->position = pos;
		this->direction = dir;

		this->speed = this->mass = 0;
	}

	//C004: Overloaded Constructor
	Shape3D::Shape3D(const Vector3 &pos, const Vector3 &dir = Vector3(), const float speed = 0, const float mass = 0 )
	{
		this->position = pos;
		this->direction = dir;

		this->speed = speed;
		this->mass = mass;
	}

	//C005: Overloaded Constructor
	Shape3D::Shape3D(const float X, const float Y = 0, const float Z = 0, const float dir = 0, const float speed = 0, const float mass = 0 )
	{
		this->position = Vector3(X, Y, Z);
		this->direction = Vector3(dir, dir, dir);

		this->speed = speed;
		this->mass = mass;
	}
#pragma endregion


#pragma region POSITION_PROPERTIES
	//M001: Getter Position
	const Vector3 Shape3D::getPosition() const
	{
		return this->position;
	}

	//M002: Setter Position
	void Shape3D::setPosition(const float X, const float Y , const float Z)
	{
		this->position.setX(X);
		this->position.setY(Y);
		this->position.setZ(Z);
	}

	//M003: Setter Position
	void Shape3D::setPosition(const Vector3 &value)
	{
		this->position.setX( value.getX() );
		this->position.setY( value.getY() );
		this->position.setZ( value.getZ() );
	}
#pragma endregion


#pragma region DIRECTION_PROPERTIES
	//M004: Getter Direction
	const Vector3 Shape3D::getDirection() const
	{
		return this->direction;
	}

	//M005: Setter Direction
	void Shape3D::setDirection(const float X, const float Y , const float Z)
	{
		this->direction.setX(X);
		this->direction.setY(Y);
		this->direction.setZ(Z);
	}

	//M006: Setter Direction
	void Shape3D::setDirection(const Vector3 &value)
	{
		this->direction.setX( value.getX() );
		this->direction.setY( value.getY() );
		this->direction.setZ( value.getZ() );
	}
#pragma endregion


#pragma region SPEED_PROPERTIES
	//M007: Getter Speed
	const float Shape3D::getSpeed() const
	{
		return this->speed;
	}

	//M008: Setter Speed
	void Shape3D::setSpeed(const float s)
	{
		this->speed = ( s < 0 ) ? 0 : s;
	}
#pragma endregion


#pragma region MASS_PROPERTIES
	//M009: Getter Mass
	const float Shape3D::getMass() const
	{
		return this->mass;
	}

	//M010: Setter Mass
	void Shape3D::setMass(const float m)
	{
		this->mass = ( m < 0 ) ? 0 : m;
	}
#pragma endregion

} /* NAMESPACE */
